home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / Expander / Expander Classes / CExpanderButton.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  1.9 KB  |  77 lines  |  [TEXT/KAHL]

  1. /***********************************************************************************
  2.     CExpanderButton.h
  3.  
  4.     Copyright © 1994 B-Ray Software. All rights reserved.
  5.     Developed using Symantec C++ 7.0.2 and Symantec's TCL library.
  6.     Portions of this code courtesy Symantec, Inc.
  7.  
  8.     This code may be freely distributed as long as this notice remains. This code
  9.     may not be used in any commercial software without the consent of B-Ray Software.
  10.  
  11.     ---
  12.  
  13.     Header for CExpanderButton class.
  14.  
  15. ***********************************************************************************/
  16. #pragma once
  17.  
  18.  
  19. #include "CExpanderPane.h"
  20.  
  21.  
  22. class CExpanderButton : public CExpanderPane {
  23.  
  24. TCL_DECLARE_CLASS
  25.  
  26. private:
  27.  
  28.     typedef enum {
  29.         kUnexpandedDisabled = 1,
  30.         kUnexpandedEnabled,
  31.         kUnexpandedHilited,
  32.         kExpandedDisabled,
  33.         kExpandedEnabled,
  34.         kExpandedHilited,
  35.         kTwirly,
  36.         kMaxIconIndex = kTwirly
  37.     } ExpanderButtonIconIndex;
  38.  
  39.     //
  40.     // class global variables
  41.     //
  42.     static short        numInstances;
  43.     static CIconHandle    icons[ kMaxIconIndex ];
  44.  
  45.     Boolean            usingColor;
  46.     Boolean            value;
  47.  
  48.     void            IExpanderButton( Boolean useColor );
  49.     short            CalcIconIndex( void );
  50.  
  51. protected:
  52.     virtual void    DrawIcon( short index );
  53.  
  54. public:
  55.     CExpanderButton();
  56.     CExpanderButton( CView *anEnclosure, CBureaucrat *aSupervisor,
  57.                      short aWidth = 0, short vWidth = 0,
  58.                      short aHLoc = 0, short aVLoc = 0, 
  59.                      SizingOption aHSizing = sizFIXEDSTICKY, SizingOption aVSizing = sizFIXEDSTICKY,
  60.                      Boolean useColor = TRUE );
  61.     virtual ~CExpanderButton();
  62.  
  63.     virtual void    SetEnabled( Boolean fEnabled );
  64.     virtual Boolean    GetEnabled( void ) { return wantsClicks; };
  65.  
  66.     virtual void    SetValue( Boolean aValue );
  67.     virtual Boolean    GetValue( void ) { return value; };
  68.  
  69.     virtual void    Draw( Rect *area );
  70.     virtual void    DoClick( Point hitPt, short modifierKeys, long when );
  71.  
  72.     virtual void    PutTo( CStream &stream );
  73.     virtual void    GetFrom( CStream &stream );
  74. };
  75.  
  76.  
  77.